package org.kyw.auth.mapper;

import org.apache.ibatis.annotations.Param;
import org.kyw.auth.domain.Role;
import org.kyw.auth.query.RoleQuery;
import org.kyw.basic.mapper.BaseMapper;

import java.util.List;

public interface RoleMapper extends BaseMapper<Role> {

    /**
     * 删除中间表数据
     * @param id
     */
    void deleteByRoleId(Long id);

    /**
     * 查询当前员工的权限
     * @param roleId
     * @return
     */
    List<Long> getMyPermissionidsByRoleId(Long roleId);

    /**
     * 删除当前角色原有的权限
     * @param roleId
     */
    void deleteRolePermissionByRoleId(Long roleId);

    /**
     * 给当前角色授权
     * @param roleId
     * @param permissionIds
     */
    void addPermission(@Param("rid")Long roleId, @Param("ids")Long[] permissionIds);
}
